﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using STS.Model;
using STS.ViewModel;

namespace STS.Model
{
    public class ModelInstance
    {
        private static STSDataContext dataContext;
        public static STSDataContext DataContext
        {
            get
            {
                if (dataContext == null)
                {
                    dataContext = new STSDataContext(databaseConnStr);
                }
                return dataContext;
            }
        }

        private static readonly string databaseConnStr = "Data Source=isostore:/STS.sdf";
        public static string DatabaseConnStr
        {
            get { return databaseConnStr; }
        }

        private static DanePacjentowViewModel danePacjentowViewModel;
        public static DanePacjentowViewModel DanePacjentowViewModel
        {
            get
            {
                if (danePacjentowViewModel == null)
                {
                    danePacjentowViewModel = new DanePacjentowViewModel();
                }
                return danePacjentowViewModel;
            }
        }

        private static LekViewModel lekViewModel;
        public static LekViewModel LekViewModel
        {
            get
            {
                if (lekViewModel == null)
                {
                    lekViewModel = new LekViewModel();
                }
                return lekViewModel;
            }
        }

        private static PoraIloscViewModel poraIloscViewModel;
        public static PoraIloscViewModel PoraIloscViewModel
        {
            get
            {
                if (poraIloscViewModel == null)
                {
                    poraIloscViewModel = new PoraIloscViewModel();
                }
                return poraIloscViewModel;
            }
        }

        private static DaneLekarzyViewModel daneLekarzyViewModel;
        public static DaneLekarzyViewModel DaneLekarzyViewModel
        {
            get
            {
                if (daneLekarzyViewModel == null)
                {
                    daneLekarzyViewModel = new DaneLekarzyViewModel();
                }
                return daneLekarzyViewModel;
            }
        }

        private static WizytaViewModel wizytaViewModel;
        public static WizytaViewModel WizytaViewModel
        {
            get
            {
                if (wizytaViewModel == null)
                {
                    wizytaViewModel = new WizytaViewModel();
                }
                return wizytaViewModel;
            }
        }

        private static BadaniaViewModel badaniaViewModel;
        public static BadaniaViewModel BadaniaViewModel
        {
            get
            {
                if (badaniaViewModel == null)
                {
                    badaniaViewModel = new BadaniaViewModel();
                }
                return badaniaViewModel;
            }
        }

        private static BadaniaMoczViewModel badaniaMoczViewModel;
        public static BadaniaMoczViewModel BadaniaMoczViewModel
        {
            get
            {
                if (badaniaMoczViewModel == null)
                {
                    badaniaMoczViewModel = new BadaniaMoczViewModel();
                }
                return badaniaMoczViewModel;
            }
        }

        private static BadaniaKrewViewModel badaniaKrewViewModel;
        public static BadaniaKrewViewModel BadaniaKrewViewModel
        {
            get
            {
                if (badaniaKrewViewModel == null)
                {
                    badaniaKrewViewModel = new BadaniaKrewViewModel();
                }
                return badaniaKrewViewModel;
            }
        }

        private static TypLekarzaViewModel typLekarzaViewModel;
        public static TypLekarzaViewModel TypLekarzaViewModel
        {
            get
            {
                if (typLekarzaViewModel == null)
                {
                    typLekarzaViewModel = new TypLekarzaViewModel();
                }
                return typLekarzaViewModel;
            }
        }

        private static OrganViewModel organViewModel;
        public static OrganViewModel OrganViewModel
        {
            get
            {
                if (organViewModel == null)
                {
                    organViewModel = new OrganViewModel();
                }
                return organViewModel;
            }
        }

        private static OsrodekViewModel osrodekViewModel;
        public static OsrodekViewModel OsrodekViewModel
        {
            get
            {
                if (osrodekViewModel == null)
                {
                    osrodekViewModel = new OsrodekViewModel();
                }
                return osrodekViewModel;
            }
        }

        private static PoiViewModel poiViewModel;
        public static PoiViewModel PoiViewModel
        {
            get
            {
                if (poiViewModel == null)
                {
                    poiViewModel = new PoiViewModel();
                }
                return poiViewModel;
            }
        }

    }
}
